package cn.htsyb.synergy.orm.jpa.model.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.MappedSuperclass;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 树型结构化 抽象类
 *
 * 
 * @author lakeside hubin_yuan.410@hotmail.com
 * @version V1.0.0
 * @since 1.0
 * @date 2022/5/11
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@Setter
@Getter
@NoArgsConstructor
@MappedSuperclass
@Schema(description = "树型结构抽象类")
public abstract class AbsStructureEntity extends AbsStandardEntity {
    private static final long serialVersionUID = 1L;
    /**
     * 模型
     */
    @Column(name = "model_", columnDefinition = "varchar(20) COMMENT '模型'")
    @Schema(name = "mode", description = "模型")
    protected String model;
    /**
     * 层级
     */
    @Column(name = "level_", columnDefinition = "int(4) COMMENT '层级'")
    @Schema(name = "level", description = "层级")
    protected Integer level;
    /**
     * 名称
     */
    @Column(name = "name_", nullable = false, length = 20, columnDefinition = " VARCHAR(20) COMMENT '名称' ")
    @Schema(name = "name", description = "名称")
    protected String name;
    /**
     * 层级名称
     */
    @Column(name = "layer_name", columnDefinition = " TEXT COMMENT '层级名称' ")
    @Schema(name = "layerName", description = "层级名称")
    protected String layerName;
    /**
     * 上级主键
     */
    @Column(name = "parent_id", length = 36, columnDefinition = " VARCHAR(36) COMMENT '上级主键' ")
    @Schema(name = "parentId", description = "上级主键")
    protected String parentId;


}